fix: merge Prompts from referenced modelkits during Kitfile resolution#1232
Merged
Merged
Conversation
amisevsk
approved these changes
Jul 22, 2026
amisevsk
left a comment
Contributor
There was a problem hiding this comment.
Good catch @AdeshDeshmukh! Thanks for this.
Contributor
|
Looks like you need to run Edit: Easy enough for me to do, I've pushed the formatting :) |
The mergeKitfiles function merges Code, DataSets, and Docs when resolving modelkit references, but silently drops Prompts. This means any prompts attached to referenced ModelKits are lost. Add the missing Prompts merge to match the existing pattern used for other slice fields (Code, DataSets, Docs). Signed-off-by: Adesh Deshmukh <adeshkd123@gmail.com>
amisevsk
force-pushed
the
fix/mergekitfiles-prompts
branch
from
July 22, 2026 16:37
5cec816 to
b39b78b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When a Kitfile has a
model.pathpointing to another ModelKit (a ModelKit reference),ResolveKitfilefollows the chain and callsmergeKitfilesto combine all assets. The function correctly mergesCode,DataSets, andDocs, but never touchesPrompts— prompts from both referenced and referencing Kitfiles are silently lost.Changes
pkg/lib/kitfile/resolve.go(+2 lines)Added the missing Prompts merge in
mergeKitfiles, mirroring the exact pattern used forCode,DataSets, andDocs:pkg/lib/kitfile/resolve_test.go(new file, ~116 lines)Added unit tests covering all mergeKitfiles prompt scenarios:
TestMergeKitfiles_PromptsTestMergeKitfiles_PreservesOtherFieldsTestMergeKitfiles_DoesNotMutateInputVerification
go build ./pkg/lib/kitfile/— cleango test ./pkg/lib/kitfile/— 28 passed (existing + new)go test ./pkg/...— 268 passed in 41 packages, zero regressionsImpact
Medium — prompts from referenced ModelKits are silently lost during resolution. This affects any user with a Kitfile chain where referenced modelkits include prompt files.
Related
mergeKitfileswas missed